from PyQt5.QtWidgets import QWidget, QDesktopWidget


class BaseWidge(QWidget):
    def __init__(self, parent=None):
        super(BaseWidge, self).__init__(parent)
        self.center()

    def center(self):
        screen = QDesktopWidget().screenGeometry()
        size = self.geometry()
        self.move((screen.width() - size.width()) / 2,
                  (screen.height() - size.height()) / 2)
